<?php

include_once ("api.php");

if (isset($_POST['email'])) {
    $mail = $_POST['email'];

    // check and store se nuovo utente

    $is_new_user = store_mail($mail);

    // invio a contact giftshake una mail di tracking sugli accessi alla demo

    $is_sent = send_mail_tracking($mail);
}


?>





<!DOCTYPE html>
<html>
  <head> 
    <title>Homepage</title> 
  
    <?php
      include_once('head.php');  
    ?> 

  </head> 
  
  <body> 

    <div data-role="page" data-theme="f">
      
      <style>
        
        .pre {
           white-space: pre-wrap;       /* css-3 */
           white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
           white-space: -pre-wrap;      /* Opera 4-6 */
           white-space: -o-pre-wrap;    /* Opera 7 */
           word-wrap: break-word;       /* Internet Explorer 5.5+ */
        }
        
      </style>
      
      <div data-role="panel" id="optpanel" data-theme="f">        
  
         <ul data-role="listview" data-inset="false" data-filter="true" data-divider-theme="b">
          <li data-role="list-divider"></li>
          <li><a href="#">Profilo</a></li>
          <li data-role="list-divider">Attività</li>
          <li><a href="#">Inviti</a></li>
          <li><a href="#">In corso</a></li>
          <li><a href="#">Da inviare</a></li>
          <li><a href="#">Inviati</a></li>
          <li data-role="list-divider"></li>
          <li><a href="#">Impostazioni</a></li>
          <li><a href="#">Logout</a></li>
        </ul>
        
      </div>  <!-- /panel -->
      
      
  
      <div data-role="header" data-theme="f">
      <a href="#optpanel" class="ui-btn-left recticon" data-role="button" data-icon="bars" data-iconpos="notext" data-theme="f" data-inline="true">Options</a>                  
        <h1>Home</h1>
        <!-- <a href="#popupMenu" class="ui-btn-right" data-rel="popup" data-role="button" data-icon="bars" data-iconpos="notext" data-transition="fade" data-theme="a" data-inline="true">Menu</a> -->
      
      </div>  <!-- header -->
    

      <!-- content -->
      <div data-role="content" style="text-align: center">  
            
        <!-- <ul data-role="listview" data-inset="true" data-count-theme="b">
          <li><a href="#">Inviti<span class="ui-li-count" style="margin-right: 20px">3</span></a></li>
          <li><a href="#">In corso<span class="ui-li-count" style="margin-right: 20px">1</span></a></li> -->
          <!-- <li><a href="#">Da inviare<span class="ui-li-count" style="margin-right: 20px">1</span></a></li> -->
          <!-- <li><a href="#">Inviati</a></li> -->
        <!-- </ul>  -->
                
        <ul data-role="listview" data-inset="false" data-divider-theme="f">          
          <li style="height: 140px"><a href="page.gift.start.php?type=single" data-ajax="false">
            <div style="float: left">
            <img style="max-width: 90px; max-height: 110px; padding-left: 5px; padding-top: 5px" src="images/tutorial/single_gift.png">
            </div>
            <div>
            <h2>Single Gift</h2>
            <p class="pre">Fai un giftshake ad un'altra persona.</p>
            </div>
            </a>
          </li>
          <li style="height: 140px"><a href="page.gift.start.php?type=group" data-ajax="false">
            <div style="float: right">
            <img style="max-width: 90px; max-height: 110px; padding-right: 5px; padding-top: 5px" src="images/tutorial/social_gift_mod.png">
            </div>
            <div>
            <h1>Group Gift</h1>
            <p class="pre">Crea un giftshake ed invita i tuoi amici a partecipare.</p>
            </div>
            
            </a>
            
          </li>
        </ul>
    
    <!--
        <hr/>
        
        <a href="page.group_gift.php" data-ajax="false" data-role="button" data-corners="false" data-inline="true" data-theme="b" >Nuovo Gift</a>
    -->    
      </div>
      
      <div style="text-align: center"  data-role="footer" data-theme="c" >
      <ul style="list-style: none; padding: 0">
        <li>
         <a data-inline="true" href="" 
             style ="text-decoration: none; font-size: 13px; color: #999999 ">Giftshake © 2013</a>       
         
         <a data-inline="true" href="" 
             style ="text-decoration: none; padding-left: 20px; font-size: 13px; color: #999999" >Guida
         </a>
        </li>
     </ul>
   </div> <!-- footer -->

    </div> <!-- page -->
 
 

  </body>
</html>